/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package campeonatobrasuka.TableModels;

import Persistencia.modelos.Relatorios.Relatorio;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author HP
 */
public class RelatorioTableModel extends AbstractTableModel{

    Relatorio rel = new Relatorio();    
    
    public int getRowCount() {
        return rel.getValores().size();
    }

    public int getColumnCount() {
        return rel.getTitulos().size();
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        List<String> get = rel.getValores().get(rowIndex);
        return get.get(columnIndex);
    }

    @Override
    public String getColumnName(int column) {
        return rel.getTitulos().get(column);
    }
    
    public void setRelatorio(Relatorio relatorio){
        rel = relatorio;
        fireTableDataChanged();
    }
}
